 {extend name="layout:base" /}{block name="content"}

 <?php
$global=isSupperManagerForSession();
 ?>
 <link rel="stylesheet" type="text/css" href="/static/My97DatePicker/skin/WdatePicker.css" />
 <script charset="utf-8" src="/static/My97DatePicker/WdatePicker.js"></script>
<style type="text/css">
    .yg_inp>input{margin-bottom: 10px;}
    #zc_detail table{margin:10px;}
    #zc_detail table tr td{
    border: 1px solid #ddd;
    height:40px;
    line-height:40px;
    padding-left:5px;
    padding-right:5px;
    }
    .ordertable input {width:90%;}
    .policeLable{padding:2px 4px;margin-left:4px;}
    #taskDate .taskDateItem{
    width:100%;height:40px;line-height:40px;margin:4px 0px;
    }
    #taskDate .taskDateItem .taskDateItemLeft{width:10%;float:left;}
    #taskDate .taskDateItem .taskDateItemRight1{width:70%;float:left;border:1px solid #139667;height: 42px;}
    #taskDate .taskDateItem .taskDateItemRight2{width:20%;float:right;}
    #taskDate .taskDateItem .opUsers img{width:22px;margin-left:5px;}

    #taskDate .taskDateItem .itemUser{padding: 4px 6px;background:#139667;margin-left:4px;color:white;}
    #taskDate .taskDateItem .clear{clear:both;width:0px;height:0px;overflow:hidden;}
    #taskDate .taskDateItem .jia,#taskDate .taskDateItem .jian{font-size:30px;cursor:pointer;font-weight:800;margin-left:5px;}

    .table tr th{text-align:center;}
    .imageLists{width:98%;margin-left:auto;margin-right:auto;}
    .imageLists .imageItem{width:100px;height:80px;float:left;margin-left:10px;}
    .imageLists .imageItem img{width:80px;margin-left:10px;overflow:hidden;}
    .fileLists{width:98%;margin-left:auto;margin-right:auto;}
    .fileLists .fileItem{width:100%;}
</style>
<script type="text/javascript" charset="utf-8" src="/static/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/static/ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="/static/ueditor/lang/zh-cn/zh-cn.js"></script>


<section class="topBanners">
         <div class="icon"></div>
         <div class="topBannersNav">
        <span data-url="/admin/hosptial/lists" onclick="ContentLoadGo('/admin/hosptial/lists')">话题管理</span>
         >
         <span data-url="/admin/hosptial/infoData"  onclick="ContentLoadGo('/admin/hosptial/infoData?id=<?php echo $id; ?>')"  >详情</span>
         
         </div>
</section>
 <section id="zc_detail">
     <input type="hidden" value="<?php echo $id; ?>" id="editId" />
   <table class="ordertable" border="0" cellspacing="0" style="width:100%;" cellpadding="0">
       <tr>
           <td width="120"><div align="right">话题分类</div></td>
           <td class="tr_cons">
               <select id="pid" class="select" name="data[pid]">
                   <option value="">--分类--</option>
                   <?php
                   foreach($allTypeLists as $key=>$val)
                   {
                   ?>
                   <option value="<?php echo $val['id']; ?>" <?php if($info['pid']==$val['id']){echo 'selected';} ?> ><?php echo $val['name']; ?></option>
                   <?php
                   }
                   ?>
               </select>
           </td>
       </tr>
       <!--<tr>-->
           <!--<td width="120"><div align="right">话题名字</div></td>-->
           <!--<td class="tr_cons">-->
             <!--<?php echo $info['name']; ?>-->
           <!--</td>-->
       <!--</tr>-->


       <tr>
           <td width="120"><div align="right">是否推荐</div></td>
           <td class="tr_cons">
               <select name="data[hot]" id="hot" class="select">
                   <option value="0" <?php if($info['hot']=='0'){echo 'selected';} ?> >普通</option>
                   <option value="1" <?php if($info['hot']=='1'){echo 'selected';} ?> >推荐</option>
               </select>
           </td>
       </tr>

       <tr>
           <td width="120"><div align="right">是否上架</div></td>
           <td class="tr_cons">
               <select name="data[stats]" id="stats" class="select">
                   <option value="0" <?php if($info['stats']=='0'){echo 'selected';} ?> >上架</option>
                   <option value="1" <?php if($info['stats']=='1'){echo 'selected';} ?> >下架</option>
               </select>
           </td>
       </tr>
       <tr>
           <td><div align="right">封面图</div></td>
           <td>
              <?php if($info['img']){echo "<img src='".$info['img']."' style='width:100px;' />";} ?>

           </td>
       </tr>



       <tr>
           <td><div align="right">内容</div></td>
           <td colspan="7">
        <?php echo $info['content']; ?>
           </td>
       </tr>

       <tr>
       <td width="120"><div align="right">排序</div></td>
       <td class="tr_cons">
           <?php echo $info['sorts']; ?>
       </td>
     </tr>

       <tr>
           <td width="120"><div align="right">点赞</div></td>
           <td class="tr_cons">
               <?php echo $info['praise']; ?>
           </td>
       </tr>

       <tr>
           <td width="120"><div align="right">回复</div></td>
           <td class="tr_cons">
               <?php echo $info['reply']; ?>
           </td>
       </tr>

       <tr>
           <td width="120"><div align="right">浏览</div></td>
           <td class="tr_cons">
               <?php echo $info['readnum']; ?>
           </td>
       </tr>
       <tr>
         <td><div align="right">发布时间</div></td>
         <td>
        
            <?php echo date("Y-m-d H:i:s",$info['ctime']); ?>
         </td>
      </tr>
       <tr>
         <td><div align="right">发布人</div></td>
         <td>
            <?php echo $info['UserInfo']['nickname']; ?>
         </td>
      </tr>
   </table>
 </section>
 <table class="table" style="margin-top:10px;">
     <tr>
         <th style="width:50px;">ID</th>
         <th style="width:100px;">类型</th>
         <th style="width:50px;">文件</th>
         <th style="width:100px;">时间</th>
         <th style="width:100px;">排序</th>
         <th style="width:120px;">操作</th>
     </tr>
     <?php
foreach($FileLists as $key=>$val)
     {
     ?>
     <tr data-id="<?php echo $val['id']; ?>">
         <td style="text-align:left;"><?php echo $val['id']; ?></td>
         <td style="text-align:left;">
             <?php
            $string = "";
            if($val['ty']==1)
            {
                $string="图片";
            }else if($val['ty']==2)
            {
                $string="音频/视频";
            }else if($val['ty']==3)
            {
                $string="文档";
            }
            echo $string;
            ?>
         </td>
         <td>
             <?php
            if($val['ty']==1)
            {
            ?>
             <img src="<?php echo $val['file']; ?>" style="max-width:50px;" />
             <?php
            }else if($val['ty']==2)
            {
                echo $val['file'];
            }else if($val['ty']==3)
            {
                echo $val['file'];
            }

            ?>

         </td>
         <td><?php echo formateDate($val['ctime']);?></td>
         <td><input type="text" style="width:98%;margin-left:0px;" class="sorts" name="sorts" value="<?php echo $val['sorts']; ?>"  /></td>
         <td style="text-align:right;">
             <?php
            if( ( in_array(30400,$ruleLists) || $global==1) )
            {
            ?>
             <input type="button" power="30400" value="删除" class="link_btn del"/>
             <?php
            }
            ?>
         </td>
     </tr>

     <?php
}
?>
 </table>
 <div style="with:100%;height:20px;"></div>

 <script type="text/javascript">
function myResearch(){
   var url="/admin/hosptial/infoData";
   var id=$("#editId").val();
   var page=$("#cpage").val();
   ContentLoadGo(url+"?id="+id+"&page="+page);
}

$(function(){
    $(".sorts").blur(function(){
        var sorts = $(this).val();
        var id=$(this).parent().parent().attr("data-id");
        var url="/admin/hosptial/fileSorts";
        var param={
            id:id,
            sorts:sorts,
            sys_opt:'edit'
        };
        AjaxRequest(url,param,function(data){
            if(data.err==0)
            {
                //SuccessTiShi(data.msg);
            }
            else
            {
                ErrTiShi(data.msg);
            }
        });
    });

    $(".del").unbind().bind("click",function(){
        var that =this;
        var url="/admin/hosptial/delFilesData";
        var id=$(that).parent().parent().attr('data-id');
        var param={
            id:id
        };
        cofirmsss_tishi(1,'您确定要删除吗?',function(id){

            AjaxRequest(url,param,function(data){
                if(data.err==0)
                {
                    SuccessTiShi("操作成功");
                    $(that).parent().parent().remove();
                }
                else
                {
                    ErrTiShi("操作失败");
                }
            });

        });
    });
   $(".research").unbind().bind("click",function(){
       var page =$(this).attr("page");
       $("#cpage").val(page);
       myResearch();
   });

   $(".info").click(function(){
       var that =this;
       var url="/admin/devlist/infoData";
       var id=$(that).parent().parent().attr('data-id');
       var param={
               id:id
       };
       ContentGet(url,param)
   });

   $(".topBannerItem").click(function(){
       var attArr = $(this).attr();
       goToSelfLink(attArr);
   });
});
</script>
{/block}
	  